<cfinclude template= "/ecada/pheader.cfm">
<!--- selects the experiment, and retrieves necessary data about the exp from db. --->
<cfquery name = "u" datasource="exp">

	SELECT e.title, e.debrief , u.name, u.email
	FROM experiment e, user u
	WHERE e.id =  <cfqueryparam cfsqltype="cf_sql_integer" value="#session.expid#">
	AND e.userid = u.id
	

</cfquery>

<!--- reads file --->
<cfset RunningLogPath = ExpandPath("#u.debrief#")>
<cffile action = "read" file ="#RunningLogPath#" variable = "debrief">

<cfif IsDefined("form.done")>
		<!--- redirects to next page --->
		<cflocation url="http://www.gla.ac.uk/">
		<cfabort>
<cfelse>
	<cfoutput>
		<h2>Thanks for taking part in the #u.title# experiment</h2>
		</br>
		<p>
			Your co-operation is much appreciated!

			#debrief#
			
			</br>
			</br>
			#u.name#
			</br>
			#u.email#
			</br>
		</p>
		<form method="post" action="/ecada/thanks.cfm">
			<input type="submit" value="Continue" name="done"/>
		</from>
	</cfoutput>
</cfif>